﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Popup.Master" AutoEventWireup="true" CodeBehind="TerminationRequestHis.aspx.cs" Inherits="vHCS.K2App.MdlK2.TerminationRequestHis" %>
<%@ Register Assembly="Core.Controls" Namespace="Core.Controls.Message" TagPrefix="cc1" %>
<%@ Register Assembly="Core.Controls" Namespace="Core.Controls.Security" TagPrefix="security" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register Assembly="Core.Controls" Namespace="Core.Controls.DataReader" TagPrefix="core" %>
<%@ Register Src="../MdlK2/Controls/HR_ctrEmpHeader_Info.ascx" TagName="EmpHeaderInfo"
    TagPrefix="uc" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainToolbar" runat="server">
    <asp:HiddenField ID="hdfEmpId" runat="server" />
    <asp:HiddenField ID="hdfHierarchyId" runat="server" />
    <asp:HiddenField ID="hdfLeaveWorkID" runat="server" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="controlWrapper">
        <uc:EmpHeaderInfo runat="server" ID="EmpHeaderInFo" />
        <div class="div6Column">
            <asp:Label ID="lblTerminalType" CssClass="label" runat="server" Text="Thông tin nhân viên xin thôi việc"
                Style="width: 30%; background-color: transparent; font-weight: bold; border-bottom: 0;
                border-right: 0" />
        </div>
        <div class="divClear">
        </div>
        <div class="div6Column">
            <div class="label" style="width: 30%">
                <asp:Label ID="lblRequester_L" runat="server" Text="Họ tên người yêu cầu" /></div>
            <div class="control" style="width: 66%">
                <asp:TextBox ID="txtRequester" runat="server" ReadOnly="true" CssClass="inputReadOnly"></asp:TextBox>
            </div>
        </div>
        <div class="divClear">
        </div>
        <div class="div6Column">
            <div class="label" style="width: 30%">
                <asp:Label ID="lblOrgChart_L" runat="server" Text="Cơ cấu tổ chức" /></div>
            <div class="control" style="width: 66%">
                <asp:TextBox ID="txtOrgChart" runat="server" ReadOnly="true" CssClass="inputReadOnly" />
            </div>
        </div>
        <div class="divClear">
        </div>
        <div class="div6Column">
            <div class="label" style="width: 30%">
                <asp:Label ID="lblLocation_L" runat="server" Text="Văn phòng làm việc" /></div>
            <div class="control" style="width: 66%">
                <asp:TextBox ID="txtLocation" runat="server" ReadOnly="true" CssClass="inputReadOnly" />
            </div>
        </div>
        <div class="divClear">
        </div>
        <div class="div6Column">
            <div class="label" style="width: 30%">
                <asp:Label ID="lblStartDate_L" runat="server" Text="Ngày vào làm việc" /></div>
            <div class="control" style="width: 66%">
                <asp:TextBox ID="txtStartDate" runat="server" ReadOnly="true" CssClass="inputReadOnly" />
            </div>
        </div>
        <div class="divClear">
        </div>
        <div class="div6Column">
            <div class="label" style="width: 30%">
                <asp:Label ID="lblEmpCode_L" runat="server" Text="Mã nhân viên" /></div>
            <div class="control" style="width: 66%">
                <asp:TextBox ID="txtEmpCode" runat="server" ReadOnly="true" CssClass="inputReadOnly" />
            </div>
        </div>
        <div class="divClear">
        </div>
        <div class="div6Column">
            <div class="label" style="width: 30%">
                <asp:Label ID="lblSignDate_L" runat="server" Text="Ngày ký hợp đồng" /></div>
            <div class="control" style="width: 66%">
                <asp:TextBox ID="txtSignDate" runat="server" ReadOnly="true" CssClass="inputReadOnly" />
            </div>
        </div>
        <div class="divClear">
        </div>
        <div class="div6Column">
            <div class="label" style="width: 30%">
                <asp:Label ID="lblJboTitle_L" runat="server" Text="Vị trí công tác" /></div>
            <div class="control" style="width: 66%">
                <asp:TextBox ID="txtJobTitle" runat="server" ReadOnly="true" CssClass="inputReadOnly" />
            </div>
        </div>
        <div class="divClear">
        </div>
        <div class="div6Column">
            <div class="label" style="width: 30%">
                <asp:Label ID="lblContractType_L" runat="server" Text="Loại hợp đồng" /></div>
            <div class="control" style="width: 66%">
                <asp:TextBox ID="txtContractType" runat="server" ReadOnly="true" CssClass="inputReadOnly" />
                <asp:Label ID="lblContactType" runat="server" Text="năm" Visible="False"></asp:Label>
                <asp:Label ID="lblContactName" runat="server" Text="Không xác định thời hạn" Visible="False"></asp:Label>
            </div>
        </div>
        <div class="divClear">
        </div>
        <div class="div6Column">
            <asp:Label ID="Label1" CssClass="label" runat="server" Text="Nhập thông tin xin thôi việc"
                Style="width: 30%; background-color: transparent; font-weight: bold; border-bottom: 0;
                border-right: 0" />
        </div>
        <div class="divClear">
        </div>
        <div class="div6Column">
            <div class="label" style="width: 30%">
                <asp:Label ID="lblRequestDate" runat="server" Text="Ngày làm đơn" /></div>
            <div class="control" style="width: 66%">
                <telerik:RadDatePicker ID="txtRequestDate" Width="120px" CssClass="datePicker" runat="server" DateInput-Enabled="false">
                    <%--<ClientEvents OnDateSelected="ShowDate" />--%>
                </telerik:RadDatePicker>
            </div>
        </div>
        <div class="divClear">
        </div>
        <div class="div6Column">
            <div class="label" style="width: 30%">
                <asp:Label ID="lblLastDateMyDream" Font-Bold="true" runat="server" Text="Ngày làm cuối cùng theo nguyện vọng của tôi" /></div>
            <div class="control" style="width: 66%">
                <telerik:RadDatePicker ID="txtLastDateMyDream" Width="120px" CssClass="datePicker"
                    runat="server" DateInput-Enabled="false">
                </telerik:RadDatePicker>
                <asp:RequiredFieldValidator ID="valRequireEndDate" runat="server" ControlToValidate="txtLastDateMyDream"
                    ErrorMessage="Nhập ngày làm cuối cùng" CssClass="validation" Display="Dynamic"
                    ValidationGroup="Save" SetFocusOnError="True">
                </asp:RequiredFieldValidator>
            </div>
        </div>
        <div class="divClear">
        </div>
        <div class="div6Column">
            <div class="label" style="width: 30%">
                <asp:Label ID="lblLasDateForLaw" runat="server" Text="Ngày làm việc cuối cùng của bạn tại công ty theo luật là" /></div>
            <div class="control" style="width: 66%">
                <telerik:RadDatePicker ID="txtLasDateForLaw" Width="120px" CssClass="datePicker"
                    runat="server" DateInput-Enabled="false">
                </telerik:RadDatePicker>
            </div>
        </div>
        <div class="divClear">
        </div>
        <div class="div6Column">
            <div class="label" style="width: 30%">
                <asp:Label ID="lblLastDateApprove" runat="server" Text="Ngày làm việc cuối cùng mà cấp trên phê duyệt" /></div>
            <div class="control" style="width: 66%">
                <telerik:RadDatePicker ID="txtLastDateApprove" Width="120px" CssClass="datePicker"
                    runat="server" DateInput-Enabled="false">
                </telerik:RadDatePicker>
            </div>
        </div>
        <div class="divClear">
        </div>
        <div class="div6Column">
            <div class="label" style="width: 30%">
                <asp:Label ID="lblTerminalReason" runat="server" Text="Lý do thôi việc" /></div>
            <div class="control" style="width: 66%">
                <asp:TextBox ID="txtTerminalReason" runat="server" Width="99%"
                     TextMode="MultiLine" CssClass="MultiText" ReadOnly="true" Height="80px">
                </asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtTerminalReason"
                    ErrorMessage="Nhập lý do thôi việc" CssClass="validation" Display="Dynamic" ValidationGroup="Save"
                    SetFocusOnError="True">
                </asp:RequiredFieldValidator>
            </div>
        </div>
        <div class="divClear"></div>
        <asp:Panel ID="pnlType" runat="server" Visible="false">
            <div class="div6Column">
                <asp:Label ID="Label11" CssClass="label" runat="server" Text="Kết luận của HRBP"
                    Style="width: 30%; background-color: transparent; font-weight: bold; border-bottom: 0;
                    border-right: 0" />
            </div>
            <div class="divClear"></div>
            <div class="div6Column">
                <div class="label" style="width: 30%">
                    <asp:Label ID="Label5" runat="server" Text="Loại thôi việc"></asp:Label><span class="require">(*)</span></div>
                <div class="control" style="width: 66%">
                    <telerik:RadComboBox ID="cboTerminalType" Width="30%" AutoPostBack="true" runat="server"
                        Filter="Contains" DataSourceID="dtsTerminalType" DataTextField="Name" AllowCustomText="false"
                        MarkFirstMatch="true" DataValueField="Id">
                    </telerik:RadComboBox>
                    <core:CoreDataSource ID="dtsTerminalType" runat="server" SelectMethod="GetComboItemsTerminalType_K2"
                        TypeName="vHCS.LS.Business.LS_TerminationTypeCollection" EnableCaching="false" MaximumRowsParameterName="">
                        <SelectParameters>
                            <asp:Parameter Name="prefix" DefaultValue="" Type="String" />
                            <asp:Parameter Name="addNullItem" DefaultValue="true" Type="Boolean" />
                            <asp:Parameter Name="getTop" DefaultValue="true" Type="Boolean" />
                        </SelectParameters>
                    </core:CoreDataSource>
                    <asp:RequiredFieldValidator ID="valRequireTerType" runat="server" ControlToValidate="cboTerminalType"
                        ErrorMessage="Chọn loại thôi việc" CssClass="validation" Display="Dynamic" ValidationGroup="Save"
                        SetFocusOnError="True">
                    </asp:RequiredFieldValidator>
                </div>
            </div>
            <div class="divClear">
            </div>
            
            <div class="div6Column">
                <div class="label" style="width: 30%">
                    <asp:Label ID="Label6" runat="server" Text="Lý do thôi việc"></asp:Label><span class="require">(*)</span></div>
                <div class="control" style="width: 66%">
                    <telerik:RadComboBox ID="cboTerminalReason" runat="server" Width="30%" DataSourceID="dtsTerminalReason"
                        DataTextField="Name" DataValueField="id" Filter="Contains" AutoPostBack="true"
                        OnClientFocus="ShowDropDown" AllowCustomText="false" MarkFirstMatch="true">
                    </telerik:RadComboBox>
                    <core:CoreDataSource ID="dtsTerminalReason" runat="server" SelectMethod="GetComboItemsTerminalReason_K2"
                        TypeName="vHCS.LS.Business.LS_TerminationTypeCollection" EnableCaching="False" MaximumRowsParameterName="">
                        <SelectParameters>
                            <asp:Parameter Name="terminationtypeid" DefaultValue="0" Type="Int64" />
                            <asp:Parameter Name="prefix" DefaultValue="" Type="String" />
                            <asp:Parameter Name="addNullItem" DefaultValue="true" Type="Boolean" />
                            <asp:Parameter Name="getTop" DefaultValue="false" Type="Boolean" />
                        </SelectParameters>
                    </core:CoreDataSource>
                    <asp:RequiredFieldValidator ID="valRequireTerReason" runat="server" ControlToValidate="cboTerminalReason"
                        ErrorMessage="Chọn lý do thôi việc" CssClass="validation" Display="Dynamic" ValidationGroup="Save"
                        SetFocusOnError="True">
                    </asp:RequiredFieldValidator>
                </div>
            </div>
            <div class="divClear">
            </div>

            <div class="div6Column">
                <asp:Label ID="Label12" CssClass="label" runat="server" Text="Đề xuất của HRBP"
                    Style="width: 30%; background-color: transparent; font-weight: bold; border-bottom: 0;
                    border-right: 0" />
            </div>
            <div class="div6Column">
                <div class="label" style="width: 30%">
                    <asp:Label ID="Label8" runat="server" Text="Đồng ý cho nhân viên nghỉ việc"></asp:Label></div>
                <div class="control" style="width: 66%">
                    <asp:RadioButton ID="radAccept" runat="server" GroupName="Propose" Checked="true" />
                </div>
            </div>
            <div class="divClear">
            </div>

            <div class="div6Column">
                <div class="label" style="width: 30%">
                    <asp:Label ID="Label9" runat="server" Text="Nên hoãn lại và đề xuất hành động để giữ nhân viên"></asp:Label></div>
                <div class="control" style="width: 66%">
                    <asp:RadioButton ID="radRefuse" runat="server" GroupName="Propose" />
                </div>
            </div>
            <div class="divClear">
            </div>

            <div class="div6Column">
                <div class="label" style="width: 30%">
                    <asp:Label ID="Label7" runat="server" Text="Đề nghị hành động để giữ nhân viên hoặc cải thiện trong thời gian tới" /></div>
                <div class="control" style="width: 66%">
                    <asp:TextBox ID="txtReasonComment" runat="server" Height="80px" Font-Names="Arial"
                        Font-Size="10" CssClass="MultiText" TextMode="MultiLine" Width="80%">
                    </asp:TextBox>
                </div>
            </div>
            <div class="divClear">
            </div>

            <div class="div6Column">
                <asp:Label ID="Label13" CssClass="label" runat="server" Text="Thông tin khác"
                    Style="width: 30%; background-color: transparent; font-weight: bold; border-bottom: 0;
                    border-right: 0" />
            </div>
            <div id="divRework" style="display: none">
                <div class="div6Column">
                    <div class="label" style="width: 30%">
                        <asp:Label ID="Label3" runat="server" Text="Xác định trường hợp này có tuyển lại hay không?" /></div>
                    <div class="control" style="width: 66%">
                        <asp:RadioButton ID="radYes" runat="server" GroupName="BlackList" Checked="true" Text="Có" />
                        <asp:RadioButton ID="radNo" runat="server" GroupName="BlackList"  Text="Không" />
                    </div>
                </div>
                <div class="divClear">
                </div>
            </div>
            <div class="divClear">
            </div>
        </asp:Panel>

        <asp:Panel ID="pnlExitSurvey" runat="server" Visible="false">
            <div class="div6Column">
                <div class="label" style="width: 30%">
                    <asp:Label ID="Label10" runat="server" Text="Xem thông tin exit survey nhân viên làm: " /></div>
                <div class="control" style="width: 66%">
                    <asp:HyperLink ID="hplSurvey_Emp" runat="server" Target="_blank"></asp:HyperLink>
                </div>
                <div class="divClear">
                </div>
            </div>
            <div class="div6Column">
                <div class="label" style="width: 30%">
                    <asp:Label ID="Label14" runat="server" Text="Xem thông tin exit survey HRBP làm: " /></div>
                <div class="control" style="width: 66%">
                    <asp:HyperLink ID="hplSurver_HRBP" runat="server" Target="_blank"></asp:HyperLink>
                </div>
            </div>
        </asp:Panel>

        <asp:Panel ID="pnlExcutor" runat="server" Visible="false">
            <div id="divExcutor">
                <div class="div6Column">
                    <div class="label" style="width: 30%">
                        <asp:Label ID="Label4" runat="server" Text="Chọn Excutor" />
                        <span class="labelRequiredField">(*)</span>
                    </div>
                    <div class="control" style="width: 66%">
                        <telerik:RadComboBox ID="cboExcutor" Width="30%" MarkFirstMatch="true" HighlightTemplatedItems="True"
                            DropDownWidth="500px" EnableLoadOnDemand="True" OnItemsRequested="RadComboBox_ItemRequested"
                            runat="server" DataSourceID="dtsReportTo" AllowCustomText="false" DataTextField="Name"
                            DataValueField="Id">
                            <HeaderTemplate>
                                <ul class="comboHeader">
                                    <li class="code">
                                        <asp:Label ID="Label2" runat="server" Text="Mã"></asp:Label>
                                    </li>
                                    <li class="name">
                                        <asp:Label ID="Label3" runat="server" Text="Tên"></asp:Label>
                                    </li>
                                    <li class="divClear"></li>
                                </ul>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <ul class="comboItem">
                                    <li class="code">
                                        <%#DataBinder.Eval(Container.DataItem, "Code")%></li>
                                    <li class="name">
                                        <%#DataBinder.Eval(Container.DataItem, "Name")%></li>
                                </ul>
                            </ItemTemplate>
                            <FooterTemplate>
                                <div class="comboFooter">
                                    <asp:Label ID="Label4" runat="server" Text="Please enter text to show more items"></asp:Label>
                                </div>
                            </FooterTemplate>
                        </telerik:RadComboBox>
                        <%--<core:CoreDataSource ID="dtsReportTo" runat="server" SelectMethod="GetComboItems"
                        TypeName="vHCS.SYS.Business.SYS_UsersCollection" MaximumRowsParameterName="">
                        <SelectParameters>
                            <asp:Parameter Name="prefix" DefaultValue="" DbType="String" />
                            <asp:Parameter Name="addNullItem" DefaultValue="true" Type="Boolean" />
                            <asp:Parameter Name="getTop" DefaultValue="true" Type="Boolean" />
                        </SelectParameters>
                    </core:CoreDataSource>--%>
                        <core:CoreDataSource ID="dtsReportTo" runat="server" SelectMethod="GetComboExecutor"
                            TypeName="vHCS.HR.Business.TER_AppForResignationCollection" MaximumRowsParameterName="">
                        </core:CoreDataSource>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="cboExcutor"
                            ErrorMessage="Vui lòng chọn người excutor phê duyệt" CssClass="validation" Display="Dynamic"
                            SetFocusOnError="true" ValidationGroup="Save">
                        </asp:RequiredFieldValidator>
                    </div>
                </div>
                <div class="divClear">
                </div>
            </div>
        </asp:Panel>

        <br />
         <div class="div4Column">
            <div class="contact">
                <asp:Label ID="Label85" runat="server" Font-Bold="true" Text="Lịch sử phê duyệt"></asp:Label>
            </div>
            <div class="divClear">
            </div>
         </div>

        <div class="divGrid">
        <telerik:RadGrid ID="dtgApprovedHistory" runat="server" DataSourceID="dtsApproveHistory"
                AutoGenerateColumns="False" AllowPaging="True" AllowMultiRowSelection="True"
                GridLines="None">
                <MasterTableView>
                    <Columns>
                        <telerik:GridDateTimeColumn DataField="SignDate" HeaderText="Ngày ký" HeaderStyle-HorizontalAlign="Center"  HeaderStyle-Width="100px" ItemStyle-HorizontalAlign="Center" DataType="System.DateTime" DataFormatString="ddMMyyyy" />            
                        <telerik:GridBoundColumn DataField="Signer" HeaderText="Người ký" HeaderStyle-Width="100px" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="center" />
                        <telerik:GridBoundColumn DataField="JobTitleName" HeaderText="Chức danh" HeaderStyle-Width="200px" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="left" />  
                        <telerik:GridBoundColumn DataField="Position" HeaderText="Chức năng" HeaderStyle-Width="100px" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="left" />
                        <telerik:GridBoundColumn DataField="Status" HeaderText="Trạng thái" HeaderStyle-Width="100px" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="left" />
                        <telerik:GridBoundColumn DataField="Note" HeaderText="Ghi chú" HeaderStyle-Width="400px" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="left" />
                    </Columns>
                    <PagerStyle Mode="NextPrevNumericAndAdvanced" PageButtonCount="5" HorizontalAlign="Left"
                        Position="Bottom" />
                </MasterTableView>
                <ClientSettings EnableRowHoverStyle="true">
                    <Selecting AllowRowSelect="True" />
                    <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="True" FrozenColumnsCount="1">
                    </Scrolling>
                </ClientSettings>
            </telerik:RadGrid>
            <core:coredatasource ID="dtsApproveHistory"  runat="server" SelectMethod="SelectHistoryTerminal"
                    TypeName="vHCS.HR.Business.HR_WorkingRecordCollection" 
                    EnableCaching="False" MaximumRowsParameterName="">
                    <SelectParameters>
                        <asp:QueryStringParameter Name="Id" DefaultValue="" DbType="Int64" QueryStringField="ID" />
                    </SelectParameters>
            </core:coredatasource>

            <div class="divClear"></div>
        </div>
    </div>
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
            <script type="text/javascript">
                function ShowRework() {
                    var div = document.getElementById("divRework");
                    div.style.display = "block";
                }
            
            </script>
        </telerik:RadCodeBlock>

    
</asp:Content>
